/*  The following functions were written by Digital.Goddess@Hotmail.com AKA Hyper
    and were taken from the dreamincode.net fora.

    The writer of the code has been banned, but for the sake of avoiding accusations
    of plagiarizing someone's work I found it necessary to make a note

    Source: http://www.dreamincode.net/forums/topic/21022-change-font-color-in-c-program/
*/

#include "basic.h"

void SetColor(const int foreground, const int background) {
    int Color = foreground + (background * 16);
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hConsole, Color);
    return;
}

void PlaceCursor(const int x, const int y) {
    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);

    COORD PlaceCursorHere;
    PlaceCursorHere.X = x;
    PlaceCursorHere.Y = y;
    SetConsoleCursorPosition(hConsole, PlaceCursorHere);

    return;
}
